import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;


public class Ex1_skew {	
	public static void main(String[] args) {		
		System.out.println(new Date());		
		try {
			String genome = KmerCounter.readFile("C:\\Users\\josemfer\\Downloads\\dataset_7_6.txt").trim();		
			//String genome = "TAAAGACTGCCGAGAGGCCAACACGAGTGCTAGAACGAGGGGCGTAAACGCGGGTCCGAT";
			int skew = 0;
			int minSkew = 1;
			ArrayList<Integer> minList = new ArrayList<Integer>();
			
			for (int i=0;i<genome.length();i++) {
				if (genome.charAt(i) == 'G') {
					skew++;
				} else if (genome.charAt(i) == 'C') {
					skew--;
				}
				
				if (skew == minSkew) {
					minList.add(i+1);
					minSkew = skew;
				} else if (skew < minSkew) {
					minList.clear();
					minList.add(i+1);
					minSkew = skew;
				}		
			}										
			System.out.println(minList);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
		System.out.println(new Date());		
	}
}
